package org.jix.gbook.user.biz.rpc;

import jakarta.annotation.Resource;
import org.jix.gbook.distributed.id.generator.api.DistributedIdGeneratorFeignApi;
import org.springframework.stereotype.Component;

/**
 * @author stark
 * @date 2025/8/2 18:01
 * @version 
 * @description
 **/
@Component
public class DistributedIdGeneratorRpcService {

    @Resource
    private DistributedIdGeneratorFeignApi distributedIdGeneratorFeignApi;

    /**
     * leaf号段模式：小黄书业务ID标识
     */
    private static final String BIZ_TAG_GBOOK_ID = "leaf-segment-gbook-id";

    /**
     * leaf号段模式：用户ID业务标识
     */
    private static final String BIZ_TAG_USER_ID = "leaf-segment-user-id";


    /**
     * 调用分布式ID生成服务生成小黄书ID
     * @return
     */
    public String getGbookId(){
        return distributedIdGeneratorFeignApi.getSegmentId(BIZ_TAG_GBOOK_ID);
    }

    /**
     * 调用分布式ID生成服务生成用户ID
     * @return
     */
    public String getUserId(){
        return distributedIdGeneratorFeignApi.getSegmentId(BIZ_TAG_USER_ID);
    }
}
